package org.eclipselabs.egf.portfolio.task.scala.test.singlefloattingpoint

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction
import java.lang.Float

class FloatEquals extends ITaskProduction{
	
	var a1 = new Float(-22.01)
	var b1 = new Float(0.52058375)
	var c1 = new Float(23.9)
	var d1 = new Float(45.91)
	var e1 = new Float(69.81)
	var f1 = new Float(1097.249)
		
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
		var a = taskProductionContext.getInputValue("inA", classOf[Float])
		var b = taskProductionContext.getInputValue("inB", classOf[Float])
		var c = taskProductionContext.getInputValue("inC", classOf[Float])
		var d = taskProductionContext.getInputValue("inD", classOf[Float])
		var e = taskProductionContext.getInputValue("inE", classOf[Float])
		var f = taskProductionContext.getInputValue("inF", classOf[Float])
		if(a == a1 && b == b1 && c == c1 && d == d1 && e == e1 && f == f1)
			EGFCorePlugin.getDefault().logWarning("Test Passed")
		else
			EGFCorePlugin.getDefault().logError("Test Failed")
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
	}
}